import PageBase from "../../../Game/Base/PageBase";
import { PAGE } from "../../../Game/Enum";
import mainRoot from "../../../Game/MainRoot";
import O1HD, { managers } from "../../../engines/gameEngine";
import level_peopleArchery from "../level_peopleArchery";

const {ccclass, property} = cc._decorator;

@ccclass
export default class level_peopleArchery_exitPage extends PageBase {

    level:level_peopleArchery = null;
    bindLevel(level:level_peopleArchery){
        this.level = level;
        this.level.gamePauseFlag = true;
    }

    onBtnClose(){
        O1HD.getManagers().soundMgr.playSound("mainSound/anNiu");
        if(!this.level.btnStart.active){
            this.level.gamePauseFlag = false;
        }
        this.BackMain();
    }

    onBtnContinue(){
        O1HD.getManagers().soundMgr.playSound("mainSound/anNiu");
        if(!this.level.btnStart.active){
            this.level.gamePauseFlag = false;
        }
        this.ClosePage();
    }

    async OnMainBtn() {
        managers().soundMgr.playSound('mainSound/anNiu');
        await this.BackMain();

        mainRoot.UISystem.OpenPage(PAGE.PEOPLE_ARCHERY_START_PAGE);
    }
    
}
